﻿/*
 * Erstellt mit SharpDevelop.
 * Benutzer: awinkler2
 * Datum: 17.08.2010
 * Zeit: 16:18
 * 
 * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
 */
using System;
using MySql.Data.MySqlClient;
using MySql;

namespace export.Database
{
	/// <summary>
	/// Holds the DatabaseConnection.
	/// </summary>
	public class DatabaseConnection
	{
		private readonly MySqlConnection mySqlConnection;

		public DatabaseConnection()
		{
			string myConnectionString;

			myConnectionString = "server=localhost;uid=sportwetten;pwd=sportwetten;database=piratesprelive;";
			try
			{
    			mySqlConnection = new MySqlConnection();
    			mySqlConnection.ConnectionString = myConnectionString;
    			mySqlConnection.Open();
			}
			catch (MySql.Data.MySqlClient.MySqlException ex)
			{
    			Console.Write(ex.Message);
			}
		}

		public MySqlConnection GetConnection() {
			return mySqlConnection;
		}
	}
}
